﻿using System;
using System.Collections.Generic;
using System.Text;
using CharacterTrailLibrary.Persist.BLL.Model;

namespace CharacterTrailLibrary.Sort
{
    public class VBomEntryAndMainModelComparer : IComparer<VBomEntryAndMainModel>
    {
        public int Compare(VBomEntryAndMainModel x, VBomEntryAndMainModel y)
        {
            if (x.ProductItemId == y.ProductItemId)
            {
                if (x.ProductVersion == y.ProductVersion)
                {
                    return x.Idx.CompareTo(y.Idx);
                }
                return x.ProductVersion.CompareTo(y.ProductVersion);
            }
            return x.ProductItemId.CompareTo(y.ProductItemId);
        }
    }
}
